Skip to content

fix(agystack): grant oneharness tools and inheritMcp to poteto-agent - #18

Merged
jtaroreh merged 2 commits into
jtaroreh:mainfrom
semantic-craft:fix/custom-agent-tool-grants
Nov 21, 2026
Merged

jtaroreh merged 2 commits into
jtaroreh:mainfrom
semantic-craft:fix/custom-agent-tool-grants

Conversation

@semantic-craft

Copy link
Copy Markdown
Contributor

Why

In Google Antigravity, custom markdown agents in agents/*.md that omit tools receive only a five-tool read-only default set and keep inheritMcp disabled. Because agents/poteto-agent.md omitted both fields, every poteto-agent spawned under the Subagent Delegation Invariant lacked edit_file, write_file, run_command, manage_task, invoke_subagent, manage_subagents, define_subagent, ask_question, and MCP access, blocking delegated code changes at startup.

At the same time, Antigravity resolves static tools entries against the oneharness tool registry while Cortex attaches call_mcp_tool, list_resources, and read_resource dynamically when inheritMcp is true. Listing those three MCP tool names directly inside tools fails executor construction with unknown component: tool "call_mcp_tool" not found in registry.

Scope

  • Update agents/poteto-agent.md frontmatter to set inheritMcp: true and grant the 13 oneharness tools required for code modification, command execution, subagent coordination, and user questions: read_file, edit_file, write_file, run_command, manage_task, send_message, schedule, invoke_subagent, manage_subagents, define_subagent, ask_question, search_web, and generate_image.
  • Extend parse_frontmatter in tests/test_agent_definitions.py to enforce line-anchored --- fences, strip unquoted # comments, and parse single-line flow lists, multiline flow lists, and - block lists.
  • Add test_poteto_agent_grants_execution_and_mcp_capabilities and test_custom_agents_only_declare_registered_oneharness_tools in tests/test_agent_definitions.py to pin REQUIRED_POTETO_AGENT_TOOLS, VALID_ONEHARNESS_AGENT_TOOLS, duplicate-tool checks, and the ban on DYNAMIC_CORTEX_MCP_TOOLS inside tools.
  • Leave agents/comment-sicko.md unchanged so it retains the read-only reviewer behavior documented in README.md and skills/poteto-mode/references/antigravity-tools.md.

Tradeoffs

  • tests/test_agent_definitions.py parses frontmatter lists with Python's standard library rather than adding PyYAML to pyproject.toml. Keeping test dependencies unchanged avoids adding a third-party parser for nine lines of agent metadata.

Blast Radius

  • Only agents/poteto-agent.md and tests/test_agent_definitions.py change.
  • Newly started Antigravity conversations that invoke TypeName: "poteto-agent" gain file-mutation, command-execution, subagent-orchestration, and inherited MCP capabilities within the existing commandExecutionPolicy: sandbox and inheritCustomizations: false boundaries.
  • Without this fix on main, every coordinator session that delegates edits over 50 lines to poteto-agent hits a read-only subagent block and has to fall back to ad-hoc agent definitions or self.

Verification

  • Reproduced both failure modes on Google Antigravity 2.30+ on macOS, observing read-only poteto-agent sessions when tools is omitted and unknown component: tool "call_mcp_tool" not found in registry when MCP wrapper names appear in tools.
  • Verified the fixed configuration on the live Antigravity runtime through GetAllPlugins RPC and live subagent invocation, confirming all 13 oneharness tools plus call_mcp_tool, list_resources, and read_resource load cleanly with zero executor errors.
  • Ran pytest -v tests/test_agent_definitions.py against origin/main before applying the agents/poteto-agent.md commit and confirmed test_poteto_agent_grants_execution_and_mcp_capabilities failed as expected.
  • Ran the full CI check suite on the two-commit branch. ruff check . passed, pytest -v tests/test_plugin_manifest.py passed, python skills/setup-agystack/scripts/setup_runtime.py --doctor returned "status": "OK", pytest -v --timeout=60 tests/ passed 394 tests with 153 subtests, and bun test in skills/poteto-mode/scripts passed all 47 tests.

Custom markdown agents that omit tools receive a read-only default set in Antigravity, while listing Cortex MCP wrappers inside tools crashes oneharness executor construction.
Without explicit oneharness tool declarations and inheritMcp, poteto-agent spawns without file-edit, shell, subagent, or MCP access and blocks delegated code modifications.
@jtaroreh
jtaroreh merged commit 9c33e07 into jtaroreh:main Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants